<jsp:include page="../template/top.jsp"></jsp:include>
	
	<div class="interfaceExterna">
		<h3><a href="#">Reservas</a></h3>
		<div>
			<table>
				<thead>
					<tr>
						<th></th>
						<th width="50px"></th>
						<th width="200px" align="left">H&oacute;spede</th>
						<th width="200px" align="left">Tipo de Apartamento</th>
						<th width="130px" align="left">Apartamento</th>
						<th width="130px" align="left">Entrada</th>
						<th width="130px" align="left">Sa&iacute;da</th>
						<th width="130px" align="left">Situa&ccedil;&atilde;o</th>
						<th>Sub Total</th>
					</tr>
				</thead>
				
				<tbody>
					<c:if test="${not empty reservaList}">
						<c:forEach var="reserva" items="${reservaList}">
							<tr>
								<td>
									<form action="${pageContext.request.contextPath}/reserva/checkin/${reserva.id}" method="get">
										<button type="submit"
												class="ui-state-default ui-corner-all" title="Checkin">
											<span class="ui-icon ui-icon-check"></span>
										</button>
									</form>
								</td>
								
								<td>
									<form action="${pageContext.request.contextPath}/reserva/checkout/${reserva.id}" method="get">
										<button type="submit"
												class="ui-state-default ui-corner-all" title="Checkout" onclick="validaCheckout(${reserva.situacao}, ${reserva.dataSaida});">
											<span class="ui-icon ui-icon-close"></span>
										</button>
									</form>
									
								</td>
								
								<td> ${reserva.hospede.nome} </td>
								<td> ${reserva.apartamento.tipoApartamento.nome} </td>
								<td> ${reserva.apartamento.numero} </td>
								<td> <fmt:formatDate value="${reserva.dataEntrada}" pattern="dd/MM/yyyy"/> </td>
								<td> <fmt:formatDate value="${reserva.dataSaida}" pattern="dd/MM/yyyy"/> </td>
								<td> ${reserva.situacao } </td>
								<td> <fmt:formatNumber currencySymbol="R$ " type="currency" value="${reserva.valorTotalDeDiarias + reserva.valorTotalDeDespesas}" /></td>
							</tr>
						</c:forEach>
					</c:if>
					<c:if test="${empty reservaList}">
						<tr>
							<td colspan="5">Nenhuma reserva encontrada!</td>
						</tr>
					</c:if>
				</tbody>
			</table>
		</div>
	</div>
	
	<br clear="all"/>
		
		<div class="botoes">
			<a href="${pageContext.request.contextPath}/reserva" id="botaoVoltar">Voltar</a>
		</div>

<jsp:include page="../template/bottom.jsp"></jsp:include>